<template>
  <view class="content">
    <view class="text-area">
      <text class="title">{{ title }}</text>
      <text class="title2">{{ tabBarIdx }}</text>
      <button @click="buleTooth()">搜索蓝牙</button>
    </view>
    <TabBar :current-page="3" />
  </view>
</template>

<script>
import TabBar from "@/components/tab-bar/TabBar.vue";

export default {
  components: {
    TabBar,
  },
  data() {
    return {
      title: "Hello",
      tabBarIdx: 3,
      tabBarList: [
        {
          pagePath: "/pages/home",
          iconPath: "/static/icon/tabBar/1.png",
          selectedIconPath: "/static/icon/tabBar/1_on.png",
          text: "首页",
        },
      ],
    };
  },
  onLoad() {},
  methods: {
    clickTab(idx) {
      this.tabBarIdx = idx;
    },
    buleTooth() {
      uni.openBluetoothAdapter({
        success(res) {
          console.log(res);
          uni.startBluetoothDevicesDiscovery({
            success(res) {
              console.log(res);
            },
          });
        },
      });
    },
  },
};
</script>

<style>
.content {
  text-align: center;
  height: 400upx;
  margin-top: 200upx;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}

.title2 {
  font-size: 36rpx;
  color: #8f8f94;
  margin-top: 300rpx;
}
</style>
